abstract class Plane {
    protected double weight; 
    protected int flyingHeight;

    public Plane(double weight, int flyingHeight) {
        this.weight = weight;
        this.flyingHeight = flyingHeight;
    }

    public abstract void takeOff();

    public abstract void accelerate();

    public abstract void land();
}

class PassengerPlane extends Plane {
    private int seatCount; 

    public PassengerPlane(double weight, int flyingHeight, int seatCount) {
        super(weight, flyingHeight);
        this.seatCount = seatCount;
    }

    @Override
    public void takeOff() {
        System.out.println("客机起飞，平稳升空。");
    }

    @Override
    public void accelerate() {
        System.out.println("客机加速，达到巡航速度。");
    }

    @Override
    public void land() {
        System.out.println("客机准备降落，减速滑行。");
    }
}

// 战斗机类
class FighterJet extends Plane {
    private int missileCount; 

    public FighterJet(double weight, int flyingHeight, int missileCount) {
        super(weight, flyingHeight);
        this.missileCount = missileCount;
    }

    @Override
    public void takeOff() {
        System.out.println("战斗机起飞，垂直升空。");
    }

    @Override
    public void accelerate() {
        System.out.println("战斗机加速，迅速达到超音速。");
    }

    @Override
    public void land() {
        System.out.println("战斗机准备降落，高速滑行。");
    }

    public void launchMissile() {
        System.out.println("战斗机发射导弹。");
    }

    public void hover() {
        System.out.println("战斗机低空盘旋。");
    }
}

// 飞行员类
class Pilot {
    public void testFly(Plane plane) {
        plane.takeOff();
        plane.accelerate();
        if (plane instanceof FighterJet) {
            // 如果是战斗机，则可以发射导弹和低空盘旋
            ((FighterJet) plane).launchMissile();
            ((FighterJet) plane).hover();
        }
        plane.land();
    }
}

// 主类
public class Main {
    public static void main(String[] args) {
        Pilot pilot = new Pilot();

        Plane passengerPlane = new PassengerPlane(100000, 10000, 150);
        pilot.testFly(passengerPlane);

        Plane fighterJet = new FighterJet(20000, 20000, 8);
        pilot.testFly(fighterJet);
    }
}
